home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / tcl70b2.lha / tcl7.0b2 / doc / for.n < prev    next >
Text File  |  1993-05-03  |  2KB  |  58 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/for.n,v 1.1 93/05/03 17:09:41 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS for tcl
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. for \- ``For'' loop
  29. .SH SYNOPSIS
  30. \fBfor \fIstart test next body\fR
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. \fBFor\fR is a looping command, similar in structure to the C
  36. \fBfor\fR statement.  The \fIstart\fR, \fInext\fR, and
  37. \fIbody\fR arguments must be Tcl command strings, and \fItest\fR
  38. is an expression string.
  39. The \fBfor\fR command first invokes the Tcl interpreter to
  40. execute \fIstart\fR.  Then it repeatedly evaluates \fItest\fR as
  41. an expression; if the result is non-zero it invokes the Tcl
  42. interpreter on \fIbody\fR, then invokes the Tcl interpreter on \fInext\fR,
  43. then repeats the loop.  The command terminates when \fItest\fR evaluates
  44. to 0.  If a \fBcontinue\fR command is invoked within \fIbody\fR then
  45. any remaining commands in the current execution of \fIbody\fR are skipped;
  46. processing continues by invoking the Tcl interpreter on \fInext\fR, then
  47. evaluating \fItest\fR, and so on.  If a \fBbreak\fR command is invoked
  48. within \fIbody\fR
  49. or \fInext\fR,
  50. then the \fBfor\fR command will
  51. return immediately.
  52. The operation of \fBbreak\fR and \fBcontinue\fR are similar to the
  53. corresponding statements in C.
  54. \fBFor\fR returns an empty string.
  55.  
  56. .SH KEYWORDS
  57. for, iteration, looping
  58.